libURLErrorData
Type
function
Summary
Returns any error that was caused during a download that was started with the load command.
Syntax
libURLErrorData(<url>)
Description
Use the libURLErrorData function to check the error status of a download.
If the download failed because of a server error--for example, if a requested web page was not found--the libURLErrorData function returns the error message sent by the server. If the download failed for another reason--for example, if the server did not respond, or if an invalid URL was supplied--the libURLErrorData function returns an error message generated by the Internet library.
The libURLErrorData function is part of the Internet library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Internet" script library is selected.
Parameters
Name | Type | Description |
---|---|---|
url | A URL, or an expression that evaluates to a URL. |
Examples
put libURLErrorData("http://www.example.org/index.html") into myErr
if libURLErrorData(it) contains "404" then answer "File doesn't exist!"
if libURLStatus(myURL) is "error" then return libURLErrorData(myURL)
Related
command: libURLSetLogField, load
control structure: function
function: libURLErrorData, cachedURLs, URLStatus
glossary: LiveCode custom library, return, Standalone Application Settings, download, cache, standalone application, command, server
keyword: https, ftp, URL, http
library: Internet library
Compatibility and Support
Introduced
LiveCode 1.1.1
OS
mac
windows
linux
web
Platforms
desktop
server